bitkeeper revision 1.319 (3f0c1fe9J6WyGCxorp5Dcd0G7QYjwQ)
authorsos22@labyrinth.cl.cam.ac.uk <sos22@labyrinth.cl.cam.ac.uk>
Wed, 9 Jul 2003 14:00:09 +0000 (14:00 +0000)
committersos22@labyrinth.cl.cam.ac.uk <sos22@labyrinth.cl.cam.ac.uk>
Wed, 9 Jul 2003 14:00:09 +0000 (14:00 +0000)
Very slight tidy up.

xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_core.c

index 32e6e39901752ce89820846bf11b63801fe78843..a792d9047c8e258b96824c7a93015ef42fbd093c 100644 (file)
@@ -149,40 +149,6 @@ static void create_proc_dom_entries(int dom)
     }
 }
 
-static int dom0_cmd_write(struct file *file, const char *buffer, size_t size,
-                         loff_t *off)
-{
-    dom0_op_t op;
-    int ret = 0;
-    
-    copy_from_user(&op, buffer, sizeof(dom0_op_t));
-
-    if ( op.cmd == MAP_DOM_MEM )
-    {
-        /* This is now an ioctl, and shouldn't be being written to the
-          command file. */
-        ret = -EOPNOTSUPP;
-    }
-    else if ( op.cmd == DO_PGUPDATES )
-    {
-        /* Now an ioctl. */
-        ret = -EOPNOTSUPP;
-    }
-    else if (op.cmd == DOM0_CREATEDOMAIN)
-    {
-        /* This is now handled through an ioctl interface. Trying to
-          do it this way means the /proc files for the new domain
-          don't get created properly. */
-        ret = -EOPNOTSUPP;
-    }
-    else
-    {
-        ret = HYPERVISOR_dom0_op(&op);
-    }
-    
-    return ret;   
-}
-
 /***********************************************************************
  *
  * Implementation of /proc/xeno/domains
@@ -277,7 +243,20 @@ static struct file_operations proc_xeno_domains_operations = {
     release:        seq_release,
 };
 
-/* END OF /proc/xeno/domains */
+/***********************************************************************
+ *
+ * Implementation of /proc/xeno/dom0_cmd
+ */
+
+static int dom0_cmd_write(struct file *file, const char *buffer, size_t size,
+                         loff_t *off)
+{
+    dom0_op_t op;
+    
+    copy_from_user(&op, buffer, sizeof(dom0_op_t));
+
+    return HYPERVISOR_dom0_op(&op);
+}
 
 static int handle_dom0_cmd_createdomain(unsigned long data)
 {
@@ -307,7 +286,7 @@ static int handle_dom0_cmd_createdomain(unsigned long data)
        succeeded, because Xen doesn't appear to want to tell us... */
 
     /* The only time I've actually got this to happen was when trying
-       to crate a domain with more memory than is actually in the
+       to create a domain with more memory than is actually in the
        machine, so we guess the error code is ENOMEM. */
     return -ENOMEM;
   }
@@ -322,20 +301,15 @@ static int handle_dom0_cmd_createdomain(unsigned long data)
 static unsigned long handle_dom0_cmd_mapdommem(unsigned long data)
 {
   struct dom0_mapdommem_args argbuf;
-  unsigned long addr;
 
   if (copy_from_user(&argbuf, (void *)data, sizeof(argbuf)))
     return -EFAULT;
-  /* This seems to be assuming that the root of the page table is in
-     the first frame of the new domain's physical memory? */
 
-  addr = direct_mmap(argbuf.start_pfn << PAGE_SHIFT,
+  return direct_mmap(argbuf.start_pfn << PAGE_SHIFT,
                     argbuf.tot_pages << PAGE_SHIFT,
                     PAGE_SHARED,
                     MAP_DISCONT,
                     argbuf.tot_pages);
-
-  return addr;
 }
 
 static int handle_dom0_cmd_unmapdommem(unsigned long data)